﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>validate</title>
    <link rel="stylesheet" href="~/Scripts/jquery-3.4.1.min.js" />
    <script type="text/javascript">


        function Ajax()
        {
         
            $.ajax({
                url: "/Home/index",
                type: "POST",
                data: { "email": $("#email").val() },
                success: function (reps) {
                    if (reps == "false") {
                        $("#msg").html("<font color='red'>该邮箱已经注册</fomt>");
                    }
                    else {
                        $("#msg").text("可以注册").css("color", "green");
                    }
                }
            })
        }
        //$("#email").blur(Ajax());
    </script>
</head>
<body>

    <div>
        <input id="email" type="text"/>
        <input type="button" value="提交" onclick="Ajax()" />
        <span id="msg"></span>
    </div>
</body>
</html>
